<template>
  <el-button
      class="customBtn"
      :type="type"
      @click="onClick">
    <slot></slot>
  </el-button>
</template>

<script setup>
import { defineProps, defineEmits } from "vue";// props emit
let props = defineProps({
  type: {
    type:String,
    default:'primary'
  }
});
let emit = defineEmits(['click']);

const onClick = ()=>{
  emit("click",props.type);
  console.log(props.type)
}


</script>

<style scoped lang="scss">
.customBtn{
  width: 300px;
}
</style>
